// vim:ft=javascript

ARG_WITH("password-argon2", "Argon2 support", "no");

if (PHP_PASSWORD_ARGON2 != "no") {
	if (CHECK_LIB("argon2_a.lib;argon2.lib", null, PHP_PASSWORD_ARGON2)
	&& CHECK_HEADER_ADD_INCLUDE("argon2.h", "CFLAGS")) {
		if (!CHECK_FUNC_IN_HEADER("argon2.h", "argon2id_hash_raw", PHP_PHP_BUILD + "\\include", "CFLAGS")) {
			ERROR("Please verify that Argon2 header and libraries >= 20161029 are installed");
		}
		AC_DEFINE('HAVE_ARGON2LIB', 1);
	} else {
		WARNING("Argon2 not enabled; libraries and headers not found");
	}
}

ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");

AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1);

CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");

ADD_FLAG("LIBS_STANDARD", "iphlpapi.lib");

EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
	crc32.c crypt.c crypt_freesec.c crypt_blowfish.c crypt_sha256.c \
	crypt_sha512.c  php_crypt_r.c " + (TARGET_ARCH != 'arm64'? " crc32_x86.c" : "") + " \
	datetime.c dir.c dl.c dns.c dns_win32.c exec.c \
	file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
	info.c iptc.c link.c mail.c math.c md5.c metaphone.c microtime.c \
	net.c pack.c pageinfo.c quot_print.c soundex.c \
	string.c scanf.c syslog.c type.c uniqid.c url.c var.c \
	versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
	url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
	php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
	user_filters.c uuencode.c filters.c proc_open.c password.c \
	streamsfuncs.c http.c flock_compat.c hrtime.c", false /* never shared */,
	'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_SOURCES("ext/standard/libavifinfo", "avifinfo.c", "standard");
PHP_STANDARD = "yes";
ADD_MAKEFILE_FRAGMENT();
PHP_INSTALL_HEADERS("", "ext/standard");
